SET IDENTITY_INSERT [CMS_Query] ON
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12749, N'deleteall', 0, N'DELETE FROM CMS_WebPart WHERE ##WHERE##', 0, 425, 0, '20110324 14:25:53', '03c002aa-6d8d-4f49-b967-030429b311a7', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12750, N'updateall', 0, N'UPDATE CMS_WebPart SET ##COLUMNS## WHERE ##WHERE##', 0, 425, 0, '20110324 14:25:53', 'a398781b-49b1-4b98-a369-81d910f3089b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4262, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_WebPartLayout WHERE [WebPartLayoutID] = @ID', 0, 1514, 0, '20110324 14:30:33', '14db164c-8aea-4c6a-b547-2e756111e60c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4266, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_WebPartLayout WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1514, 0, '20110324 14:30:34', 'ffa0f1ed-1bda-4035-b85c-cf199269a51c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7366, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_WebPartLayout WHERE (WebPartLayoutLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1514, 0, '20110324 14:30:34', '948de7bb-ffe8-496b-a4aa-c7735afb3b9a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12751, N'deleteall', 0, N'DELETE FROM CMS_WebPartLayout WHERE ##WHERE##', 0, 1514, 0, '20110324 14:30:34', '82d61612-acfd-4c49-b5dc-2b37ae6b4306', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12752, N'updateall', 0, N'UPDATE CMS_WebPartLayout SET ##COLUMNS## WHERE ##WHERE##', 0, 1514, 0, '20110324 14:30:34', '1139d84a-1c3d-4558-8cb7-9ccd12c7935d', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3109, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_Transformation WHERE [TransformationID] = @ID', 0, 162, 0, '20110324 14:34:44', 'fbe239ff-103d-4908-aee6-992f7eb87a82', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (1150, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Transformation WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 162, 0, '20110324 14:34:44', '974d8ecc-ec90-4053-ad12-e90a7af6ce25', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7365, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Transformation WHERE (TransformationLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 162, 0, '20110324 14:34:44', 'a0f141e2-0543-470c-bc5d-99904eadae57', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12753, N'deleteall', 0, N'DELETE FROM CMS_Transformation WHERE ##WHERE##', 0, 162, 0, '20110324 14:34:44', 'e19dd9e6-2252-466b-b6ca-45386d096d0f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12754, N'updateall', 0, N'UPDATE CMS_Transformation SET ##COLUMNS## WHERE ##WHERE##', 0, 162, 0, '20110324 14:34:44', '686843ce-68b5-4792-b005-8145ea163760', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2248, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_Layout WHERE [LayoutID] = @ID', 0, 410, 0, '20110324 17:07:19', '8bdd310f-585c-4123-ae2b-575dbdb332e1', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (630, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Layout WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 410, 0, '20110324 17:07:19', '27e92771-64cc-44b0-a3eb-3e71ef54cb5b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4853, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Layout WHERE (LayoutLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 410, 0, '20110324 17:07:19', '75cc9cde-8e26-4e58-b5d3-5039b2a7ffb4', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12755, N'deleteall', 0, N'DELETE FROM CMS_Layout WHERE ##WHERE##', 0, 410, 0, '20110324 17:07:19', 'e80a0e28-2e78-40a8-bba7-fbffed29b7bf', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12756, N'updateall', 0, N'UPDATE CMS_Layout SET ##COLUMNS## WHERE ##WHERE##', 0, 410, 0, '20110324 17:07:19', '08d58ba4-c1d3-4d73-bcb2-ba5a61cc6879', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2763, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_Customer WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1157, 0, '20110325 08:38:35', 'a40ccc3c-5bea-4b77-a5b0-14041ca660a0', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12759, N'deleteall', 0, N'DELETE FROM COM_Customer WHERE ##WHERE##', 0, 1157, 0, '20110325 08:38:35', 'be795114-8db9-4e92-9a8b-d9309aba30e4', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12760, N'updateall', 0, N'UPDATE COM_Customer SET ##COLUMNS## WHERE ##WHERE##', 0, 1157, 0, '20110325 08:38:35', '97ba4cbc-96a9-47ab-864b-67117ba4e64a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2812, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_ShoppingCart WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1162, 0, '20110325 08:41:38', '4bd57b3b-a572-4e2d-8c49-337b93f4494f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12765, N'deleteall', 0, N'DELETE FROM COM_ShoppingCart WHERE ##WHERE##', 0, 1162, 0, '20110325 08:41:38', 'fd5fa50c-154f-4eb7-a2cc-d385904be3f1', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12766, N'updateall', 0, N'UPDATE COM_ShoppingCart SET ##COLUMNS## WHERE ##WHERE##', 0, 1162, 0, '20110325 08:41:38', '8dc250ac-c1ad-4f13-a305-f0ec954c0631', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11799, N'isauthorizedperproject', 0, N'SELECT PM_ProjectRolePermission.ProjectID, PM_ProjectRolePermission.RoleID, 
PM_ProjectRolePermission.PermissionID, CMS_Permission.PermissionName FROM 
PM_ProjectRolePermission INNER JOIN CMS_Permission ON CMS_Permission.PermissionID =
 PM_ProjectRolePermission.PermissionID WHERE (PM_ProjectRolePermission.ProjectID =
  @ProjectID) AND ((PM_ProjectRolePermission.RoleID IN (
      SELECT RoleID FROM View_CMS_UserRoleMembershipRole WHERE (SiteID IS NULL OR SiteID = @SiteID) AND (UserID =@UserID) AND
       (ValidTo IS NULL OR ValidTo > @ValidTo))
   )
    OR (PM_ProjectRolePermission.RoleID IN (SELECT CMS_Role.RoleID FROM CMS_Role WHERE RoleName IN 
    (##GENERICROLES##) AND CMS_Role.SiteID=@SiteID)))', 0, 2742, 0, '20110325 10:21:19', '7b3c6328-c36f-484d-89e6-ff83a29045f9', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (464, N'selectaclitemsbyaclidanduserid', 0, N'SELECT  DISTINCT X.Allowed,X.Denied,X.ValidTo,X.ACLID
 FROM (
 SELECT CMS_ACLItem.Allowed,CMS_ACLItem.Denied, null AS ''ValidTo'',CMS_ACL.ACLID
  FROM CMS_ACL INNER JOIN CMS_ACLItem ON CMS_ACLItem.ACLID = CMS_ACL.ACLID   
  WHERE
    --User  
      (CMS_ACLItem.UserID IN (SELECT CMS_User.UserID FROM CMS_User JOIN CMS_UserSite ON CMS_User.UserID = CMS_UserSite.UserID
                         WHERE CMS_User.UserID = @UserID AND CMS_UserSite.SiteID = @SiteID )    
    -- Specific roles        
        OR CMS_ACLItem.RoleID IN (SELECT RoleID FROM CMS_Role WHERE RoleName IN (##GENERICROLES##))
       )   
    -- Membership
  UNION ALL
  SELECT  DISTINCT CMS_ACLItem.Allowed,CMS_ACLItem.Denied, UserRole.ValidTo,CMS_ACL.ACLID
    FROM CMS_ACL INNER JOIN CMS_ACLItem ON CMS_ACLItem.ACLID = CMS_ACL.ACLID  
    INNER JOIN  [View_CMS_UserRoleMembershipRole] AS UserRole ON UserRole.RoleID = CMS_ACLItem.RoleID        
      WHERE (UserRole.ValidTo  > @Date OR UserRole.ValidTo IS NULL)
        AND (UserRole.SiteID = @SiteID OR UserRole.SiteID IS NULL)   
        AND UserRole.UserID = @UserID      
   ) AS X
   WHERE ##WHERE##', 0, 225, 0, '20110331 18:19:00', '12e0b3bc-a73b-4b76-9307-fcaee609b019', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12793, N'selectfromview', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_OM_Account_Joined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2837, 0, '20110401 10:44:13', '5cf88ac3-8cc2-44a4-91be-6c17afe39525', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12445, N'selectlastvalidrate', 0, N'SELECT ExchangeRateValue 
FROM COM_CurrencyExchangeRate INNER JOIN COM_ExchangeTable ON COM_CurrencyExchangeRate.ExchangeTableID = COM_ExchangeTable.ExchangeTableID 
WHERE ((ExchangeRateToCurrencyID = @CurrencyID) AND (ISNULL(COM_ExchangeTable.ExchangeTableSiteID, 0) = @SiteID) AND ((ExchangeTableValidFrom <= @CurrentDate) OR (ExchangeTableValidFrom IS NULL)) AND ((ExchangeTableValidTo >= @CurrentDate) OR (ExchangeTableValidTo IS NULL))) 
ORDER BY ExchangeTableValidFrom DESC, CASE WHEN ExchangeTableValidTo IS NULL THEN 2 ELSE 1 END, ExchangeTableValidTo', 0, 1202, 0, '20110401 13:56:32', '3bae8d74-46c7-4da3-892b-69e982067153', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3404, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Reporting_ReportGraph WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1339, 0, '20110404 13:42:57', '7caea5a8-676d-470a-ac53-fcb2b8552a92', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12801, N'deleteall', 0, N'DELETE FROM Reporting_ReportGraph WHERE ##WHERE##', 0, 1339, 0, '20110404 13:42:57', '76635965-5de6-4165-9551-8b1eb088dd70', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12802, N'updateall', 0, N'UPDATE Reporting_ReportGraph SET ##COLUMNS## WHERE ##WHERE##', 0, 1339, 0, '20110404 13:42:57', 'f67048e6-f0d5-4d87-92f6-bc859eee9729', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12805, N'removedependencies', 1, N'Proc_OM_MVTVariant_RemoveDependencies', 1, 2807, 0, '20110405 15:38:54', '4b398e7f-0804-4b0e-8e04-ec496aaa2b74', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12177, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_Membership WHERE [MembershipID] = @ID', 0, 2785, 0, '20110405 19:09:05', '1400f9eb-57e5-478f-9912-a292397044e8', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12178, N'delete', 0, N'DELETE FROM CMS_Membership WHERE [MembershipID] = @ID', 0, 2785, 0, '20110405 19:09:05', 'abb2f6d6-9c2c-4c5d-be4e-8c0d92019797', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12179, N'insert', 0, N'INSERT INTO CMS_Membership ([MembershipName], [MembershipDisplayName], [MembershipDescription], [MembershipLastModified], [MembershipGUID], [MembershipSiteID] ) VALUES ( @MembershipName, @MembershipDisplayName, @MembershipDescription, @MembershipLastModified, @MembershipGUID, @MembershipSiteID); SELECT SCOPE_IDENTITY() AS [MembershipID]', 1, 2785, 0, '20110405 19:09:05', '87908f10-d097-4198-b0eb-3a3c863d4c1b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12180, N'update', 0, N'UPDATE CMS_Membership SET [MembershipName] = @MembershipName, [MembershipDisplayName] = @MembershipDisplayName, [MembershipDescription] = @MembershipDescription, [MembershipLastModified] = @MembershipLastModified, [MembershipGUID] = @MembershipGUID, [MembershipSiteID] = @MembershipSiteID WHERE [MembershipID] = @MembershipID', 0, 2785, 0, '20110405 19:09:05', '5730efe5-b024-491d-b75d-4a7a0951756f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12181, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Membership WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2785, 0, '20110405 19:09:05', '9da8edc8-84b3-4aef-b48d-694b80425616', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12806, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Membership WHERE (MembershipLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 2785, 0, '20110405 19:09:05', '862ebe92-bac8-4089-806a-bb2d9a228cb3', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12182, N'deleteall', 0, N'DELETE FROM CMS_Membership WHERE ##WHERE##', 0, 2785, 0, '20110405 19:09:05', '491b80b6-23e4-46c4-8ae3-dfbeeb98810e', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12183, N'updateall', 0, N'UPDATE CMS_Membership SET ##COLUMNS## WHERE ##WHERE##', 0, 2785, 0, '20110405 19:09:05', '5b9d6f48-e3d6-4dea-b898-cc901d6ebac3', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11654, N'deleteall', 0, N'DELETE FROM Messaging_Message WHERE ##WHERE## AND (MessageRecipientDeleted = 1) AND (MessageSenderDeleted = 1)', 0, 1593, 1, '20110407 09:50:51', '18776c73-1a60-4818-b0d1-4eeff52e3ee3', 0, 1)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2981, N'selectallWithExchangeRate', 0, N'SELECT * FROM COM_Currency WHERE CurrencyID IN (SELECT ExchangeRateToCurrencyID FROM COM_CurrencyExchangeRate WHERE COM_CurrencyExchangeRate.ExchangeTableID = @TableID) AND (CurrencyEnabled = 1) AND (ISNULL(CurrencySiteID, 0) = @SiteID)', 0, 1143, 0, '20110407 14:03:03', 'e12a3863-f3fb-4e15-af29-ddbff0889a52', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4280, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_CustomerCreditHistory WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1518, 0, '20110412 08:04:09', 'db5f3abf-aac1-4bf7-bd4d-378bbaa44926', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11925, N'deleteall', 0, N'DELETE FROM COM_CustomerCreditHistory WHERE ##WHERE##', 0, 1518, 0, '20110412 08:04:09', 'b65bb647-1f42-4594-b226-179cba134965', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11926, N'updateall', 0, N'UPDATE COM_CustomerCreditHistory SET ##COLUMNS## WHERE ##WHERE##', 0, 1518, 0, '20110412 08:04:09', '5ffe7ab0-6239-40fc-acd9-a2631001e09b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4152, N'selecttree', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_CMS_Tree_Joined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 144, 0, '20110413 00:15:02', '0855b378-64da-4093-a680-707bbf6b3349', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4153, N'selecttreeversions', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_CMS_Tree_Joined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 144, 0, '20110413 00:37:43', '7b3edbd9-6857-49a2-843f-31b6d9fbcf64', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12858, N'removedependencies', 1, N'Proc_OM_Account_RemoveDependencies', 1, 2837, 0, '20110414 15:40:08', '3562cf21-e98a-4909-b910-84e7c41aa1b7', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4783, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_Permission WHERE [PermissionID] = @ID', 0, 131, 0, '20110415 13:05:42', 'd484fd7d-06c7-449d-b66e-a665bd4f04ea', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4784, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Permission WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 131, 0, '20110415 13:05:42', 'c73d8934-9633-4473-9606-bd78ae5f5b92', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7359, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Permission WHERE (PermissionLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 131, 0, '20110415 13:05:42', '894e625f-9183-4ae7-84cc-7dc965f68c47', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12889, N'deleteall', 0, N'DELETE FROM CMS_Permission WHERE ##WHERE##', 0, 131, 0, '20110415 13:05:42', '90b2046e-2dca-4c0c-bb07-51d590dd0ba0', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12890, N'updateall', 0, N'UPDATE CMS_Permission SET ##COLUMNS## WHERE ##WHERE##', 0, 131, 0, '20110415 13:05:42', '068d4fa5-4e19-4ac9-91d7-2110e69ab3a9', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12909, N'checkdependencies', 0, N'SELECT AccountStatusID 
FROM OM_AccountStatus
WHERE AccountStatusID IN 
  (SELECT AccountStatusID FROM OM_Account  WHERE AccountStatusID = @ID)', 0, 2840, 0, '20110421 17:03:19', '5135c023-702f-4124-a023-11ed0a3daa69', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (686, N'selectpageinfo', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_PageInfo WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 143, 0, '20110422 09:30:50', '294567cf-f826-471c-8eb2-01443e243beb', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12888, N'selectcountforsites', 0, N'SELECT EmailSiteID, COUNT(EmailSiteID) as EmailCount FROM CMS_Email WHERE ##WHERE## GROUP BY EmailSiteID', 0, 1809, 0, '20110422 11:20:17', 'df7584a7-8f89-4d64-96e6-fc792a0919d0', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12803, N'CombineCombinationVariation', 1, N'Proc_OM_CombineMVTCombinationVariation', 1, 2814, 0, '20110422 11:35:41', 'f184d45e-8004-4c44-90de-d1d2c121a3da', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12910, N'removedependencies', 1, N'Proc_OM_Contact_RemoveDependencies', 1, 2841, 0, '20110422 13:24:24', '66d46ca0-798f-4401-89a5-ba348c9f5df6', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12911, N'selectDocumentsAdvanced', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_CMS_Tree_Joined
LEFT JOIN CMS_WorkflowStep ON View_CMS_Tree_Joined.DocumentWorkflowStepID=CMS_WorkflowStep.StepID
LEFT JOIN CMS_Culture ON View_CMS_Tree_Joined.DocumentCulture = CMS_Culture.CultureCode
WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 144, 0, '20110422 14:36:36', '54042032-d8d6-494f-9f12-21a2a42be936', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12912, N'EnableCombinations', 1, N'Proc_OM_EnableMVTCombinations', 1, 2808, 0, '20110422 15:01:13', '87b86d08-c6f7-4ccb-ac3c-a08e42e9c294', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5110, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_UserSite WHERE [UserSiteID] = @ID', 0, 1634, 0, '20110427 10:01:31', '8f7da8fc-c0a4-4ade-9f0b-069d9bd0c1fb', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5114, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_UserSite WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1634, 0, '20110427 10:01:31', '3f41501a-67d4-4dd1-8e53-dc107a1b954c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12841, N'deleteall', 0, N'DELETE FROM CMS_UserSite WHERE ##WHERE##', 0, 1634, 0, '20110427 10:01:31', 'ab0ee3ab-11d2-4a1f-a9b5-d8c146b798b0', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12842, N'updateall', 0, N'UPDATE CMS_UserSite SET ##COLUMNS## WHERE ##WHERE##', 0, 1634, 0, '20110427 10:01:31', 'aef1c0a9-1096-4fa3-b67a-97103684c9d1', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7566, N'selectroles', 0, N'SELECT ##TOPN## ##COLUMNS## FROM 
(
  SELECT CMS_Role.*, ValidTo FROM CMS_Role JOIN CMS_UserRole ON CMS_Role.RoleID = CMS_UserRole.RoleID WHERE  UserID = @UserID
  UNION ALL
  SELECT *,NULL FROM CMS_Role  WHERE RoleName IN (##GENERICROLES##) 
) 
AS X WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 59, 0, '20110427 13:22:15', 'ca5aa200-7fe1-4c51-82a5-b41e97889bf1', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3961, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_TaxClassState WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1448, 0, '20110428 13:36:02', '4a92b753-e5d0-4bad-8583-cbfbfd215acc', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12943, N'deleteall', 0, N'DELETE FROM COM_TaxClassState WHERE ##WHERE##', 0, 1448, 0, '20110428 13:36:02', '7c4f23b0-391b-4fcc-8386-3e1cfa495503', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12594, N'updateall', 0, N'UPDATE COM_TaxClassState SET ##COLUMNS## WHERE ##WHERE##', 0, 1448, 0, '20110428 13:36:02', 'afaf2f8f-f766-4c86-b376-308ce8ced92c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2790, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_TaxClassCountry WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1154, 0, '20110428 13:56:33', 'f6a8d2e8-c1a8-4424-b231-36260655ca9a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12944, N'deleteall', 0, N'DELETE FROM COM_TaxClassCountry WHERE ##WHERE##', 0, 1154, 0, '20110428 13:56:33', '18f158b9-e011-477c-93c3-785f447b4fd3', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12593, N'updateall', 0, N'UPDATE COM_TaxClassCountry SET ##COLUMNS## WHERE ##WHERE##', 0, 1154, 0, '20110428 13:56:33', '32b3afcc-48c3-48e2-a68a-3ab6702a1b5b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (431, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_VersionHistory WHERE [VersionHistoryID] = @ID', 0, 214, 0, '20110428 21:51:39', '7691c2a4-898c-4a4a-b46d-277d9d7d4e59', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5161, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_VersionHistory WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 214, 0, '20110428 21:51:39', '8001c6f1-4d4b-4853-b7b1-69f6dbd5a24a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12407, N'deleteall', 0, N'DELETE FROM CMS_VersionHistory WHERE ##WHERE##', 0, 214, 0, '20110428 21:51:39', '6674dddf-9984-42d2-bf4f-23c5ebe0e235', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12223, N'updateall', 0, N'UPDATE CMS_VersionHistory SET ##COLUMNS## WHERE ##WHERE##', 0, 214, 0, '20110428 21:51:39', '56e18658-2934-43c8-9a5a-e5962b726162', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2178, N'selectrecyclebin', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_VersionHistory JOIN CMS_Class ON CMS_Class.ClassID = VersionClassID
WHERE 
(VersionDeletedWhen IS NOT NULL) AND (NodeSiteID=@SiteID OR NodeSiteID IS NULL OR @SiteID = 0) AND ##WHERE## 
ORDER BY ##ORDERBY##', 0, 214, 0, '20110429 09:03:30', '686d7d53-3851-4958-868a-cc81e3cb31f7', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (10326, N'selectAllUserDocuments', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_CMS_UserDocuments WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 144, 0, '20110504 17:48:07', '4b4953f4-639a-46c0-a8f3-91719fba3b8f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12708, N'select', 0, N'SELECT ##COLUMNS## FROM OM_UserAgent WHERE [UserAgentID] = @ID', 0, 2856, 0, '20110506 14:06:18', '92a72493-08ea-4798-849f-9a6c6ec33210', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12709, N'delete', 0, N'DELETE FROM OM_UserAgent WHERE [UserAgentID] = @ID', 0, 2856, 0, '20110506 14:06:18', '957dc06a-7bd9-4379-b5b9-a0f3b0f279ea', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12710, N'insert', 0, N'INSERT INTO OM_UserAgent ([UserAgentString], [UserAgentActiveContactID], [UserAgentOriginalContactID], [UserAgentCreated] ) VALUES ( @UserAgentString, @UserAgentActiveContactID, @UserAgentOriginalContactID, @UserAgentCreated); SELECT SCOPE_IDENTITY() AS [UserAgentID]', 1, 2856, 0, '20110506 14:06:19', '5e58113b-a6a1-4e41-9e93-ab8307e5bef5', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12711, N'update', 0, N'UPDATE OM_UserAgent SET [UserAgentString] = @UserAgentString, [UserAgentActiveContactID] = @UserAgentActiveContactID, [UserAgentOriginalContactID] = @UserAgentOriginalContactID, [UserAgentCreated] = @UserAgentCreated WHERE [UserAgentID] = @UserAgentID', 0, 2856, 0, '20110506 14:06:19', '537c35b6-5988-4164-96e9-00a53305eaa7', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12712, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM OM_UserAgent WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2856, 0, '20110506 14:06:19', 'eaaa9430-2931-4e6b-a169-63632f669873', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12713, N'deleteall', 0, N'DELETE FROM OM_UserAgent WHERE ##WHERE##', 0, 2856, 0, '20110506 14:06:19', '0a93dbdf-b749-4fc7-83cf-f027a7d4f65f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12714, N'updateall', 0, N'UPDATE OM_UserAgent SET ##COLUMNS## WHERE ##WHERE##', 0, 2856, 0, '20110506 14:06:19', 'a6560a17-2cda-410e-8c23-265c224efc57', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (216, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_Tree WHERE [NodeID] = @ID', 0, 143, 0, '20110509 14:14:40', 'b9b990d3-5301-4c1d-822e-958b78a07e92', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3356, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Tree WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 143, 0, '20110509 14:14:40', 'ebe10eaf-9adc-4fd3-aef4-566c2543bd32', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12975, N'deleteall', 0, N'DELETE FROM CMS_Tree WHERE ##WHERE##', 0, 143, 0, '20110509 14:14:40', '384b9757-2811-4f59-a992-4b8ae5427729', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12976, N'updateall', 0, N'UPDATE CMS_Tree SET ##COLUMNS## WHERE ##WHERE##', 0, 143, 0, '20110509 14:14:40', '74c59b70-6c67-4fe3-8958-6c38c96bb6a2', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13001, N'deleteall', 0, N'DELETE FROM Integration_SyncLog WHERE ##WHERE##', 0, 2886, 0, '20110510 04:12:24', '16be0f7b-670b-4a7e-90ee-2ca72d38d420', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13002, N'updateall', 0, N'UPDATE Integration_SyncLog SET ##COLUMNS## WHERE ##WHERE##', 0, 2886, 0, '20110510 04:12:24', 'f3a0ce75-fb87-4cca-bef8-e98d89936458', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12996, N'select', 0, N'SELECT ##COLUMNS## FROM Integration_SyncLog WHERE [SyncLogID] = @ID', 0, 2886, 0, '20110510 04:12:31', '4b84b555-4b3a-4bae-a502-0a8545620751', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12997, N'delete', 0, N'DELETE FROM Integration_SyncLog WHERE [SyncLogID] = @ID', 0, 2886, 0, '20110510 04:12:31', 'f2b0948d-0148-4a2a-bdd0-25fe7bfda38f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13000, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Integration_SyncLog WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2886, 0, '20110510 04:12:31', '9c202639-a5f0-42e5-91fa-461cc2ed4ce7', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13008, N'deleteall', 0, N'DELETE FROM Integration_Synchronization WHERE ##WHERE##', 0, 2887, 0, '20110510 04:15:26', '79ccf41b-2a31-48e5-9200-e6afd110062f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13009, N'updateall', 0, N'UPDATE Integration_Synchronization SET ##COLUMNS## WHERE ##WHERE##', 0, 2887, 0, '20110510 04:15:26', 'ee62560b-4111-4547-afa4-f0cefa0adcc4', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13003, N'select', 0, N'SELECT ##COLUMNS## FROM Integration_Synchronization WHERE [SynchronizationID] = @ID', 0, 2887, 0, '20110510 04:15:28', '27bc04aa-fcf0-4cca-a294-d2e740294e39', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13004, N'delete', 0, N'DELETE FROM Integration_Synchronization WHERE [SynchronizationID] = @ID', 0, 2887, 0, '20110510 04:15:28', 'c1dc21d0-1806-4d2a-b2d2-2fa6d735a125', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13007, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Integration_Synchronization WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2887, 0, '20110510 04:15:28', '0de0eb9a-6195-4305-a3ba-fff9328b17c9', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12839, N'selectfromcontactview', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_OM_AccountContact_ContactJoined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2848, 0, '20110510 10:13:14', 'e5c99dce-662d-4714-b2bc-f0048c13d13b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13010, N'selectfromaccountview', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_OM_AccountContact_AccountJoined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2848, 0, '20110510 10:19:12', 'af4052e1-6ce2-4469-a5d5-0dc70570e6c6', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12701, N'select', 0, N'SELECT ##COLUMNS## FROM OM_IP WHERE [IPID] = @ID', 0, 2855, 0, '20110510 11:13:45', 'c41b52e5-ee1e-43cd-87a3-039e8fa4c61f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12702, N'delete', 0, N'DELETE FROM OM_IP WHERE [IPID] = @ID', 0, 2855, 0, '20110510 11:13:45', '3cf7707e-a116-453b-9e0e-56abeac85065', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12703, N'insert', 0, N'INSERT INTO OM_IP ([IPActiveContactID], [IPOriginalContactID], [IPAddress], [IPCreated] ) VALUES ( @IPActiveContactID, @IPOriginalContactID, @IPAddress, @IPCreated); SELECT SCOPE_IDENTITY() AS [IPID]', 1, 2855, 0, '20110510 11:13:45', '136dc9f8-1dcf-4178-935c-c076284746b8', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12704, N'update', 0, N'UPDATE OM_IP SET [IPActiveContactID] = @IPActiveContactID, [IPOriginalContactID] = @IPOriginalContactID, [IPAddress] = @IPAddress, [IPCreated] = @IPCreated WHERE [IPID] = @IPID', 0, 2855, 0, '20110510 11:13:45', 'c6dac081-9060-451d-aa6a-97061733984c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12705, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM OM_IP WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2855, 0, '20110510 11:13:45', '13de5947-a87c-4b29-9c26-420506c16ff8', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12706, N'deleteall', 0, N'DELETE FROM OM_IP WHERE ##WHERE##', 0, 2855, 0, '20110510 11:13:45', 'cf9ccd5d-7e85-46a1-bef9-f2349db32317', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12707, N'updateall', 0, N'UPDATE OM_IP SET ##COLUMNS## WHERE ##WHERE##', 0, 2855, 0, '20110510 11:13:45', '772c89e6-f0a5-4d98-b646-ec7462c5a9ae', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13011, N'removedependencies', 1, N'Proc_OM_Activity_RemoveDependencies', 0, 2854, 0, '20110511 14:17:42', 'd993f079-eebf-4d88-abb6-62473e1e2931', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13041, N'selectlog', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Staging_SyncLog INNER JOIN Staging_Server ON Staging_SyncLog.SyncLogServerID = Staging_Server.ServerID
INNER JOIN Staging_Task ON Staging_SyncLog.SyncLogTaskID = Staging_Task.TaskID
WHERE (TaskID = @TaskID OR @TaskID = 0) AND (ServerID = @ServerID OR @ServerID = 0) AND ##WHERE## ORDER BY ##ORDERBY##', 0, 2886, 0, '20110515 19:28:53', '6a295ecf-328a-4e3d-8295-a8161cfea571', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13030, N'select', 0, N'SELECT ##COLUMNS## FROM Analytics_ConversionCampaign WHERE [ConversionCampaignID] = @ConversionCampaignID AND [CampaignID] = @CampaignID AND [ConversionID] = @ConversionID', 0, 2893, 0, '20110516 14:06:19', '12b65bc6-b521-41f6-af08-48e7e3c6d49f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13033, N'update', 0, N'SELECT NULL', 0, 2893, 0, '20110516 14:06:19', 'ec06d260-f875-4370-98f8-307696571656', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13034, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Analytics_ConversionCampaign WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2893, 0, '20110516 14:06:19', 'bf8a3c5d-f93d-45ab-a3b9-a82247cf6952', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13035, N'deleteall', 0, N'DELETE FROM Analytics_ConversionCampaign WHERE ##WHERE##', 0, 2893, 0, '20110516 14:06:19', 'b1e543a8-c3ef-4405-9793-398887513c55', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13036, N'updateall', 0, N'UPDATE Analytics_ConversionCampaign SET ##COLUMNS## WHERE ##WHERE##', 0, 2893, 0, '20110516 14:06:19', 'c030e75a-56e0-4458-aab3-7e7534d894fc', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13032, N'insert', 0, N'INSERT INTO Analytics_ConversionCampaign ([CampaignID], [ConversionID] ) VALUES ( @CampaignID, @ConversionID);', 1, 2893, 0, '20110516 14:16:30', '62ca6baf-957e-4ac0-926d-5d99de33e7ef', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13031, N'delete', 0, N'DELETE FROM Analytics_ConversionCampaign WHERE  [CampaignID] = @CampaignID AND [ConversionID] = @ConversionID', 0, 2893, 0, '20110516 14:28:47', 'c4b889a0-85d3-4cf1-a88e-ae551f303edb', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2676, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_OrderStatus WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1146, 0, '20110516 14:54:41', '6aba9913-e963-4c75-9f15-160fbb8c16fc', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13053, N'deleteall', 0, N'DELETE FROM COM_OrderStatus WHERE ##WHERE##', 0, 1146, 0, '20110516 14:54:41', '0d7a62d1-e40d-4c34-8955-1d8c3f7f387c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13054, N'updateall', 0, N'UPDATE COM_OrderStatus SET ##COLUMNS## WHERE ##WHERE##', 0, 1146, 0, '20110516 14:54:41', '4d969e7d-4dc8-447b-873a-4cea11087cdf', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13061, N'removedependencies', 1, N'Proc_Integration_Task_RemoveDependencies', 0, 2885, 0, '20110518 18:17:10', '80c0fceb-11d6-4b11-8e32-5b14c69f8525', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13040, N'removedependencies', 1, N'Proc_Integration_Connector_RemoveDependencies', 0, 2884, 0, '20110518 18:17:20', '70a29941-0d8f-4fe6-a6e9-a2e6af5ac159', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12983, N'delete', 0, N'DELETE FROM Integration_Connector WHERE [ConnectorID] = @ID', 0, 2884, 0, '20110518 18:20:17', 'af387385-1799-462f-82cb-f9f39f309e1e', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12987, N'deleteall', 0, N'DELETE FROM Integration_Connector WHERE ##WHERE##', 0, 2884, 0, '20110518 18:20:25', '82f634f6-0509-4aba-aa5b-6be30cc07c0c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12982, N'select', 0, N'SELECT ##COLUMNS## FROM Integration_Connector WHERE [ConnectorID] = @ID', 0, 2884, 0, '20110518 18:20:39', 'f0508453-26e3-49c0-848f-0c40d46295ec', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12986, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Integration_Connector WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2884, 0, '20110518 18:20:46', '913b054d-f7b9-46c1-ba88-6002894f32dc', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12988, N'updateall', 0, N'UPDATE Integration_Connector SET ##COLUMNS## WHERE ##WHERE##', 0, 2884, 0, '20110518 18:20:55', '45e4bc6d-1bc9-478e-b478-2ddca509dfdd', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6038, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_Category WHERE [CategoryID] = @ID', 0, 1721, 0, '20110519 07:36:11', 'd39ff3c1-a585-41d6-8930-f5bf544c19f1', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7342, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Category WHERE (CategoryLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1721, 0, '20110519 07:36:11', '48768a7c-172d-4b72-941a-42328b81b50a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13062, N'deleteall', 0, N'DELETE FROM CMS_Category WHERE ##WHERE##', 0, 1721, 0, '20110519 07:36:11', 'b0df63ec-94b7-41d7-895a-840029d52177', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13063, N'updateall', 0, N'UPDATE CMS_Category SET ##COLUMNS## WHERE ##WHERE##', 0, 1721, 0, '20110519 07:36:11', 'e551f55b-d6fc-493c-b3d1-6dd7daf800b5', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13075, N'setidpath', 0, N'UPDATE [CMS_Category] SET  [CategoryIDPath] = @Path WHERE [CategoryID] = @ID', 0, 1721, 0, '20110519 16:01:15', 'bea19964-b508-4a02-877f-00845a509b2c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13076, N'logexitpage', 0, N'IF ((SELECT COUNT(*) FROM [Analytics_ExitPages] WHERE ExitPageLastModified < @Date) >= 0)
BEGIN
    DELETE FROM [Analytics_ExitPages] WHERE SessionIdentificator = @SessionID
    INSERT INTO [Analytics_ExitPages] ([SessionIdentificator], [ExitPageNodeID], [ExitPageLastModified], [ExitPageSiteID], [ExitPageCulture]) VALUES (@SessionID, @NodeID, @Date, @SiteID, @Culture)
END', 1, 1366, 0, '20110520 15:46:02', '843ace51-9c16-4148-af62-402104631b04', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6042, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Category WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1721, 0, '20110520 15:54:33', 'a3edd7c6-dd2a-402f-9a0a-ad452aeac9bc', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13079, N'deleteselected', 0, N'DELETE FROM CMS_EmailUser WHERE ##WHERE##', 1, 1926, 0, '20110522 21:19:49', 'c7adbc9e-d62e-40b5-9733-b498dd675714', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13081, N'selectexitpages', 0, N'SELECT ##TOPN## ##COLUMNS## FROM [Analytics_ExitPages] WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1366, 0, '20110523 14:09:46', '5caae63f-9d54-4d66-9cfa-e0b41d1ab5df', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13082, N'removeexitpages', 0, N'DELETE FROM [Analytics_ExitPages] WHERE ##WHERE##', 0, 1366, 0, '20110523 14:12:48', 'd34a6e96-3fd0-462e-8a6f-30b303139b8c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3334, N'select', 0, N'SELECT ##COLUMNS## FROM Polls_Poll WHERE [PollID] = @ID', 0, 1330, 0, '20110524 09:35:17', '188884e3-2e01-4a49-bc79-887337f322cd', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3338, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Polls_Poll WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1330, 0, '20110524 09:35:18', '1fedd931-db4e-4d5f-982e-701e3cc34565', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13083, N'deleteall', 0, N'DELETE FROM Polls_Poll WHERE ##WHERE##', 0, 1330, 0, '20110524 09:35:18', '13fb2d53-4ef6-479d-bd77-f2d014dee816', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13084, N'updateall', 0, N'UPDATE Polls_Poll SET ##COLUMNS## WHERE ##WHERE##', 0, 1330, 0, '20110524 09:35:18', 'e35b3bb0-5b8b-46a7-8890-6520da5e3adb', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13091, N'removechildversions', 1, N'Proc_CMS_Class_RemoveChildVersions', 0, 145, 0, '20110524 16:38:55', '26f1bd02-12c7-470e-a682-825c13d2b26c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13092, N'removechildversions', 1, N'Proc_CMS_Site_RemoveChildVersions', 0, 52, 0, '20110524 17:13:09', 'afbabb00-5464-428f-a1e9-ad2d9272c244', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13094, N'removechildversions', 1, N'Proc_Reporting_ReportCategory_RemoveChildVersions', 0, 1431, 0, '20110524 18:10:12', '18192925-fe6d-44d5-9df1-e77eddbcc919', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13107, N'resetaccountmaincontacts', 0, N'UPDATE OM_Account SET [AccountPrimaryContactID] = NULL WHERE [AccountPrimaryContactID] ##WHERE##;UPDATE OM_Account SET [AccountSecondaryContactID] = NULL WHERE [AccountSecondaryContactID] ##WHERE##', 0, 2848, 0, '20110526 13:10:18', '91bde9ee-4799-46ad-bdd4-8db5dd481780', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (440, N'selectdocumentstobepublished', 0, N'SELECT VersionHistoryID FROM CMS_VersionHistory WHERE WasPublishedFrom IS NULL AND ((PublishFrom IS NULL OR (PublishFrom IS NOT NULL AND PublishFrom <= @DateNow)) AND (PublishTo IS NULL OR (PublishTo IS NOT NULL AND PublishTo >= @DateNow))) AND ToBePublished = 1 AND NodeSiteID = @NodeSiteID ORDER BY PublishFrom', 0, 214, 0, '20110527 09:50:29', '2f0ee8ce-a253-4469-ab3c-4b6364e317bf', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11811, N'getPermissionMatrix', 0, N'SELECT ##TOPN## Matrix.##COLUMNS##, CASE WHEN PM_ProjectRolePermission.RoleID IS NULL THEN 0 ELSE 1 END AS Allowed 
FROM 
  (
    SELECT CMS_Permission.PermissionID, CMS_Permission.PermissionDisplayName, CMS_Permission.PermissionName, CMS_Permission.PermissionDescription, CMS_Role.RoleID, CMS_Role.Rolename, CMS_Role.RoleDisplayName , CMS_Role.SiteID
    FROM CMS_Permission, CMS_Role 
    WHERE 
      ResourceID = @ID AND 
      RoleID IN (
        SELECT RoleID 
        FROM CMS_Role 
        WHERE
          ##WHERE## AND
          (SiteID IS NULL OR SiteID = @SiteID)
      )
  ) Matrix
  LEFT JOIN PM_ProjectRolePermission ON (Matrix.PermissionID = PM_ProjectRolePermission.PermissionID AND PM_ProjectRolePermission.RoleID = Matrix.RoleID AND PM_ProjectRolePermission.ProjectID = @ProjectID)
ORDER BY ##ORDERBY##', 0, 2743, 0, '20110527 16:48:06', '37bed004-408f-4714-aea7-73d1ec7256d6', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6920, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Community_Friend WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1898, 0, '20110530 11:40:40', 'b10b238f-be72-48de-a4a4-bdf0b61542eb', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13108, N'deleteall', 0, N'DELETE FROM Community_Friend WHERE ##WHERE##', 0, 1898, 0, '20110530 11:40:40', 'eb2c2ef8-cf70-45b2-8225-fb52cecadfa6', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13109, N'updateall', 0, N'UPDATE Community_Friend SET ##COLUMNS## WHERE ##WHERE##', 0, 1898, 0, '20110530 11:40:40', 'acd89a07-29b4-4050-8eac-68edff37f8f9', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9194, N'getPermissionMatrix', 0, N'SELECT ##TOPN## Matrix.##COLUMNS##, CASE WHEN CMS_WidgetRole.RoleID IS NULL THEN 0 ELSE 1 END AS Allowed FROM 
(SELECT CMS_Permission.PermissionID, CMS_Permission.PermissionDisplayName, CMS_Permission.PermissionName, CMS_Permission.PermissionDescription, 
CMS_Role.RoleID, CMS_Role.Rolename, CMS_Role.RoleDisplayName FROM CMS_Permission, CMS_Role WHERE ResourceID = @ID AND RoleID IN (SELECT RoleID FROM
CMS_Role WHERE ##WHERE## AND ((@SiteID = 0 AND SiteID IS NULL) OR SiteID = @SiteID))) Matrix LEFT JOIN CMS_WidgetRole ON (Matrix.PermissionID = CMS_WidgetRole.PermissionID
AND CMS_WidgetRole.RoleID = Matrix.RoleID AND CMS_WidgetRole.WidgetID = @WidgetID) ORDER BY ##ORDERBY##', 0, 2199, 0, '20110530 12:05:23', '1a8f6835-55a4-4f6d-959c-49dba76cc2d1', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13110, N'removechildversions', 1, N'Proc_Newsletter_Newsletter_RemoveChildVersions', 0, 913, 0, '20110530 13:37:43', 'c7ea2776-9cf9-4b2d-aa15-b6496018f40a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13093, N'removechildversions', 1, N'Proc_Reporting_Report_RemoveChildVersions', 0, 1338, 0, '20110530 13:44:05', '20a6b62f-99f0-4255-9461-7c1fab919d47', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8040, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_SearchIndex WHERE [IndexID] = @ID', 0, 2043, 0, '20110601 15:00:06', '734e6bac-af08-46c8-9b3b-4e874b177f15', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8041, N'delete', 0, N'DELETE FROM CMS_SearchIndex WHERE [IndexID] = @ID', 0, 2043, 0, '20110601 15:00:06', 'f9150bdb-a036-4716-bf01-20e4cf213985', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8042, N'insert', 0, N'INSERT INTO CMS_SearchIndex ([IndexName], [IndexDisplayName], [IndexAnalyzerType], [IndexIsCommunityGroup], [IndexSettings], [IndexGUID], [IndexLastModified], [IndexLastRebuildTime], [IndexType], [IndexStopWordsFile], [IndexCustomAnalyzerAssemblyName], [IndexCustomAnalyzerClassName], [IndexBatchSize], [IndexStatus], [IndexLastUpdate] ) VALUES ( @IndexName, @IndexDisplayName, @IndexAnalyzerType, @IndexIsCommunityGroup, @IndexSettings, @IndexGUID, @IndexLastModified, @IndexLastRebuildTime, @IndexType, @IndexStopWordsFile, @IndexCustomAnalyzerAssemblyName, @IndexCustomAnalyzerClassName, @IndexBatchSize, @IndexStatus, @IndexLastUpdate); SELECT SCOPE_IDENTITY() AS [IndexID]', 1, 2043, 0, '20110601 15:00:06', '575501ca-d782-4e8f-918f-9d3a1b7528bb', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8043, N'update', 0, N'UPDATE CMS_SearchIndex SET [IndexName] = @IndexName, [IndexDisplayName] = @IndexDisplayName, [IndexAnalyzerType] = @IndexAnalyzerType, [IndexIsCommunityGroup] = @IndexIsCommunityGroup, [IndexSettings] = @IndexSettings, [IndexGUID] = @IndexGUID, [IndexLastModified] = @IndexLastModified, [IndexLastRebuildTime] = @IndexLastRebuildTime, [IndexType] = @IndexType, [IndexStopWordsFile] = @IndexStopWordsFile, [IndexCustomAnalyzerAssemblyName] = @IndexCustomAnalyzerAssemblyName, [IndexCustomAnalyzerClassName] = @IndexCustomAnalyzerClassName, [IndexBatchSize] = @IndexBatchSize, [IndexStatus] = @IndexStatus, [IndexLastUpdate] = @IndexLastUpdate WHERE [IndexID] = @IndexID', 0, 2043, 0, '20110601 15:00:06', 'fb5469b6-53a1-41a8-86d5-179996d22895', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8044, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_SearchIndex WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2043, 0, '20110601 15:00:06', '5ddbbe47-155d-4fff-a22f-81ab0c5101c7', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (8045, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_SearchIndex WHERE (IndexLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 2043, 0, '20110601 15:00:06', '086bb341-e050-4785-8f24-ce7a0e2f5baf', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11911, N'deleteall', 0, N'DELETE FROM CMS_SearchIndex WHERE ##WHERE##', 0, 2043, 0, '20110601 15:00:06', 'a1d0d2f1-887e-4799-ad7d-3145fa5fea13', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (11912, N'updateall', 0, N'UPDATE CMS_SearchIndex SET ##COLUMNS## WHERE ##WHERE##', 0, 2043, 0, '20110601 15:00:06', '0e09f2f3-f033-4c10-aef6-7aa5320ddd64', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9282, N'UpdateChildPaths', 1, N'Proc_CMS_PageTemplateCategory_UpdateChildPaths', 0, 405, 0, '20110603 10:38:57', '3699d623-d276-4646-8eed-273e6c2b972d', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13126, N'selectfromaccountview', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_OM_ContactGroupMember_AccountJoined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2852, 0, '20110603 11:11:28', '0b7c2bc9-e8e0-42a9-ab48-84a22bd0ea88', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (1345, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Newsletter_Newsletter WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 913, 0, '20110603 15:41:52', 'a0aabba1-9d8d-466a-808a-a08cfb15dc8f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13042, N'deleteall', 0, N'DELETE FROM Newsletter_Newsletter WHERE ##WHERE##', 0, 913, 0, '20110603 15:41:52', '01eb59b8-1811-43d8-8996-e6b40676f617', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13043, N'updateall', 0, N'UPDATE Newsletter_Newsletter SET ##COLUMNS## WHERE ##WHERE##', 0, 913, 0, '20110603 15:41:52', '7ac47f52-7002-4d90-8ce8-fbac56a30f2b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6263, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_Avatar WHERE [AvatarID] = @ID', 0, 1750, 0, '20110607 08:54:16', '275677d2-b7c5-412b-9966-309772e7e757', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6267, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Avatar WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1750, 0, '20110607 08:54:16', '2842e4a2-0707-4a79-bf0b-8138eb0c6a35', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7339, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Avatar WHERE (AvatarLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1750, 0, '20110607 08:54:16', '7fd774f5-3b32-48f3-aab1-556ab9e40833', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13131, N'selectnobinary', 0, N'SELECT [AvatarID], [AvatarName], [AvatarFileName], [AvatarFileExtension], [AvatarType], [AvatarIsCustom], [AvatarGUID], [AvatarLastModified], [AvatarMimeType], [AvatarFileSize], [AvatarImageHeight], [AvatarImageWidth], [DefaultMaleUserAvatar], [DefaultFemaleUserAvatar], [DefaultGroupAvatar], [DefaultUserAvatar] FROM CMS_Avatar WHERE [AvatarID] = @ID', 0, 1750, 0, '20110607 08:54:16', 'dc58512a-eb9c-42b7-9e57-805a9712ea71', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6369, N'selectallnobinary', 0, N'SELECT ##TOPN## [AvatarID], [AvatarName], [AvatarFileName], [AvatarFileExtension], [AvatarType], [AvatarIsCustom], [AvatarGUID], [AvatarLastModified], [AvatarMimeType], [AvatarFileSize], [AvatarImageHeight], [AvatarImageWidth], [DefaultMaleUserAvatar], [DefaultFemaleUserAvatar], [DefaultGroupAvatar], [DefaultUserAvatar] ##COLUMNS## FROM CMS_Avatar WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1750, 0, '20110607 08:54:16', '16f35b14-65e9-4fe5-be8f-1d0c917c3021', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13132, N'deleteall', 0, N'DELETE FROM CMS_Avatar WHERE ##WHERE##', 0, 1750, 0, '20110607 08:54:16', '4e72f08b-59ee-4351-9963-0db707092ea1', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13133, N'updateall', 0, N'UPDATE CMS_Avatar SET ##COLUMNS## WHERE ##WHERE##', 0, 1750, 0, '20110607 08:54:16', 'a7945a68-365f-4273-8b1c-b6a3f4939f95', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3473, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Reporting_SavedGraph WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1349, 0, '20110607 08:54:39', 'b757084d-ff3a-4992-a4cb-07dadaeb4605', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5216, N'selectallnobinary', 0, N'SELECT ##TOPN## [SavedGraphID], [SavedGraphSavedReportID], [SavedGraphGUID], [SavedGraphMimeType], [SavedGraphLastModified] ##COLUMNS## FROM Reporting_SavedGraph WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1349, 0, '20110607 08:54:39', '638a5e00-dc41-4c77-b6fe-1cd71527a040', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13134, N'deleteall', 0, N'DELETE FROM Reporting_SavedGraph WHERE ##WHERE##', 0, 1349, 0, '20110607 08:54:39', '20694679-d7df-4e97-84e1-2a0f9026d34a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13135, N'updateall', 0, N'UPDATE Reporting_SavedGraph SET ##COLUMNS## WHERE ##WHERE##', 0, 1349, 0, '20110607 08:54:39', 'ab7ffece-f278-468e-a808-8b18b6f27b53', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6995, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Forums_Attachment WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1912, 0, '20110607 08:55:36', '9e67dff8-b5da-48ff-bb8a-5ecfbe6dc43c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7618, N'selectallnobinary', 0, N'SELECT ##TOPN## [AttachmentID], [AttachmentFileName], [AttachmentFileExtension], [AttachmentGUID], [AttachmentLastModified], [AttachmentMimeType], [AttachmentFileSize], [AttachmentImageHeight], [AttachmentImageWidth], [AttachmentPostID], [AttachmentSiteID] ##COLUMNS## FROM Forums_Attachment WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1912, 0, '20110607 08:55:36', '547c28c6-a985-4a54-a1c8-9322bbabab36', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13136, N'deleteall', 0, N'DELETE FROM Forums_Attachment WHERE ##WHERE##', 0, 1912, 0, '20110607 08:55:38', '4d0ee705-8d62-4d5b-a837-900c8e54f185', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13137, N'updateall', 0, N'UPDATE Forums_Attachment SET ##COLUMNS## WHERE ##WHERE##', 0, 1912, 0, '20110607 08:55:38', '94b24d7f-400a-48b3-94f9-ff0bd334b83d', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6475, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_EmailAttachment WHERE [AttachmentID] = @ID', 0, 1790, 0, '20110607 08:55:51', '93e0c2d4-a63b-473d-9098-04ef462663ad', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6479, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_EmailAttachment WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1790, 0, '20110607 08:55:51', 'd11a2ade-af94-4135-a425-3895193c5efc', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7348, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_EmailAttachment WHERE (AttachmentLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1790, 0, '20110607 08:55:51', 'e7d9b849-da58-4ae6-b2fa-82a8925d93a6', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7615, N'selectnobinary', 0, N'SELECT [AttachmentID], [AttachmentName], [AttachmentExtension], [AttachmentSize], [AttachmentMimeType], [AttachmentGUID], [AttachmentLastModified], [AttachmentContentID], [AttachmentSiteID] FROM CMS_EmailAttachment WHERE [AttachmentID] = @ID', 0, 1790, 0, '20110607 08:55:51', 'a19dc9e1-5c7a-4fc7-8695-692e4702b1f2', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7616, N'selectallnobinary', 0, N'SELECT ##TOPN## [AttachmentID], [AttachmentName], [AttachmentExtension], [AttachmentSize], [AttachmentMimeType], [AttachmentGUID], [AttachmentLastModified], [AttachmentContentID], [AttachmentSiteID] ##COLUMNS## FROM CMS_EmailAttachment WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1790, 0, '20110607 08:55:51', '3e4ace97-04ee-40a9-84e9-1bc59e6c6d49', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13138, N'deleteall', 0, N'DELETE FROM CMS_EmailAttachment WHERE ##WHERE##', 0, 1790, 0, '20110607 08:55:51', '75bf324a-1cd6-486c-a547-996313aab8b9', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13139, N'updateall', 0, N'UPDATE CMS_EmailAttachment SET ##COLUMNS## WHERE ##WHERE##', 0, 1790, 0, '20110607 08:55:51', 'b9b6a287-3cbf-4310-8f12-c153ae7d88cf', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2470, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Forums_ForumGroup WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1121, 0, '20110607 09:08:36', 'eb65c823-d1b8-4336-b3ea-d6dcbb49dcee', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13140, N'deleteall', 0, N'DELETE FROM Forums_ForumGroup WHERE ##WHERE##', 0, 1121, 0, '20110607 09:08:36', '1b389373-3663-45e2-a698-753b5ac573cf', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13141, N'updateall', 0, N'UPDATE Forums_ForumGroup SET ##COLUMNS## WHERE ##WHERE##', 0, 1121, 0, '20110607 09:08:36', '36f6237a-bebd-4ca2-8de1-6f10389f2915', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13142, N'removedependencies', 1, N'Proc_CMS_Country_RemoveDependencies', 0, 1125, 0, '20110608 13:20:25', '22a2f5c7-511f-45d6-861d-dbed33f029e8', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13153, N'selectfrommembershipview', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_OM_Account_MembershipJoined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2837, 0, '20110609 14:02:34', '0824b36a-27a6-464a-986d-15941fc71c10', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12666, N'select', 0, N'SELECT ##COLUMNS## FROM OM_AccountContact WHERE [AccountContactID] = @ID', 0, 2848, 0, '20110610 10:17:13', 'adbc45b8-2897-4d04-b170-a923824eee72', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12667, N'delete', 0, N'DELETE FROM OM_AccountContact WHERE [AccountContactID] = @ID', 0, 2848, 0, '20110610 10:17:13', 'd31b85c3-dfcc-4e4e-91e6-46323ecf0f13', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12668, N'insert', 0, N'INSERT INTO OM_AccountContact ([ContactRoleID], [AccountID], [ContactID] ) VALUES ( @ContactRoleID, @AccountID, @ContactID); SELECT SCOPE_IDENTITY() AS [AccountContactID]', 1, 2848, 0, '20110610 10:17:13', '39349855-f64d-4b03-a2fc-927dea9a224d', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12669, N'update', 0, N'UPDATE OM_AccountContact SET [ContactRoleID] = @ContactRoleID, [AccountID] = @AccountID, [ContactID] = @ContactID WHERE [AccountContactID] = @AccountContactID', 0, 2848, 0, '20110610 10:17:13', '43103fb6-b7a3-4bf3-8ce8-f572a3d9823f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12670, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM OM_AccountContact WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2848, 0, '20110610 10:17:13', 'fd31e10f-c928-440a-9ea8-9ac18be3692a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12671, N'deleteall', 0, N'DELETE FROM OM_AccountContact WHERE ##WHERE##', 0, 2848, 0, '20110610 10:17:13', '308b30d5-8a85-4ab6-837a-16e6421c3d4c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12672, N'updateall', 0, N'UPDATE OM_AccountContact SET ##COLUMNS## WHERE ##WHERE##', 0, 2848, 0, '20110610 10:17:13', 'cfdb7c53-2627-43c7-90b4-e440e3b45fc0', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12999, N'update', 0, N'UPDATE Integration_SyncLog SET [SyncLogSynchronizationID] = @SyncLogSynchronizationID, [SyncLogTime] = @SyncLogTime, [SyncLogErrorMessage] = @SyncLogErrorMessage WHERE [SyncLogID] = @SyncLogID', 0, 2886, 0, '20110613 10:45:59', 'cc7ce300-442e-4c3d-9996-ba7c419df9b5', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12998, N'insert', 0, N'INSERT INTO Integration_SyncLog ([SyncLogSynchronizationID], [SyncLogTime], [SyncLogErrorMessage] ) VALUES ( @SyncLogSynchronizationID, @SyncLogTime, @SyncLogErrorMessage); SELECT SCOPE_IDENTITY() AS [SyncLogID]', 1, 2886, 0, '20110613 10:47:26', '5f8e9f9e-6a3f-4f3f-8271-27e2e534beb9', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9509, N'getroleswhocanapprove', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Role WHERE RoleID IN (SELECT RoleID FROM CMS_WorkflowStepRoles WHERE (StepID = @StepID)) AND (SiteID=@SiteID OR SiteID IS NULL) AND ##WHERE## ORDER BY ##ORDERBY##', 0, 172, 0, '20110613 14:37:39', 'a853f33b-9bce-4f77-8bb0-839adb37414f', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13176, N'selectconnectors', 0, N'SELECT DISTINCT ##TOPN## ConnectorName FROM View_Integration_Task_Joined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2887, 0, '20110613 15:44:37', '97bc5437-581a-498f-aa53-48d208194082', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12469, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_MembershipUser WHERE [MembershipUserID] = @ID', 0, 2820, 0, '20110613 16:22:50', '0e7ab71b-42eb-44c5-9ad8-caba692d59c7', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12470, N'delete', 0, N'DELETE FROM CMS_MembershipUser WHERE [MembershipUserID] = @ID', 0, 2820, 0, '20110613 16:22:50', '4567a263-5d66-4cc3-adbf-a52cc594ecd6', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12471, N'insert', 0, N'INSERT INTO CMS_MembershipUser ([MembershipID], [UserID], [ValidTo], [SendNotification] ) VALUES ( @MembershipID, @UserID, @ValidTo, @SendNotification); SELECT SCOPE_IDENTITY() AS [MembershipUserID]', 1, 2820, 0, '20110613 16:22:50', 'fd7efb9a-1467-41b9-9d58-77a3a49cc60d', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12472, N'update', 0, N'UPDATE CMS_MembershipUser SET [MembershipID] = @MembershipID, [UserID] = @UserID, [ValidTo] = @ValidTo, [SendNotification] = @SendNotification WHERE [MembershipUserID] = @MembershipUserID', 0, 2820, 0, '20110613 16:22:50', '43678797-d5c7-44f2-a2db-3b1cac119938', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12473, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_MembershipUser WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2820, 0, '20110613 16:22:50', '52663dc5-a1b3-4e28-9dc0-3cefb7879399', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12474, N'deleteall', 0, N'DELETE FROM CMS_MembershipUser WHERE ##WHERE##', 0, 2820, 0, '20110613 16:22:50', '825ebb55-9a0b-452e-8c21-6fee1203243c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12475, N'updateall', 0, N'UPDATE CMS_MembershipUser SET ##COLUMNS## WHERE ##WHERE##', 0, 2820, 0, '20110613 16:22:50', '1fd01a3b-a29d-4587-9801-9c1e0a4e22b8', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13177, N'selectlist', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_CMS_DocumentAlias_Joined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1719, 0, '20110615 10:07:32', '1fd90b0b-08a6-4798-89e4-a25529412776', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2766, N'selectlist', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_COM_Customer_Joined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1157, 0, '20110615 10:46:30', 'c5b8ff49-36ba-4886-a170-b38953d8ac0c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5347, N'selectlist', 0, N'SELECT CMS_PageTemplateCategory.*, (SELECT COUNT(PageTemplateID) FROM CMS_PageTemplate WHERE CMS_PageTemplate.PageTemplateCategoryID=CMS_PageTemplateCategory.CategoryID) AS PageTemplateCount FROM CMS_PageTemplateCategory WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 405, 0, '20110615 10:48:01', '64b959d5-ca01-4aab-a467-ad473346e0ff', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12585, N'selectlist', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_CMS_ObjectVersionHistoryUser_Joined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2828, 0, '20110615 10:48:43', 'fd90c0e5-6957-4e47-a62a-01e885b3d33c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13059, N'selectlist', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_Integration_Task_Joined WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2885, 0, '20110615 10:49:13', '29e295ea-e2ac-4993-9f1c-64b4f77e2405', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (9711, N'getboardlist', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Board_Board 
JOIN View_CMS_Tree_Joined ON (BoardDocumentID = DocumentID) AND (NodeLinkedNodeID IS NULL) AND ##WHERE##', 0, 1788, 0, '20110616 09:33:31', '94fdff4e-1ff3-48a5-bfb5-e4135250b5aa', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13213, N'generatesampledata', 1, N'Proc_Analytics_GenerateSampleData', 0, 1366, 0, '20110616 11:53:31', '61ba281e-f1c9-4e13-a742-63cea3f226f1', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13214, N'moverelations', 1, N'Proc_OM_Contact_MoveRelations', 0, 2841, 0, '20110617 10:49:47', '0ee0127b-30d6-4c42-bb90-5a5a06225c08', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13215, N'splitrelations', 1, N'Proc_OM_Contact_SplitRelations', 0, 2841, 0, '20110620 09:56:24', '1b5b3dc8-e314-416c-8626-ae895ab02fa5', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13216, N'duplicaterelations', 1, N'Proc_OM_Contact_DuplicateRelations', 0, 2841, 0, '20110620 13:13:13', '4cf8d785-5a1c-4014-91f2-0e86654e0ff6', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13217, N'removedependencies', 1, N'Proc_Integration_Synchronization_RemoveDependencies', 0, 2887, 0, '20110620 14:17:53', '86c59225-9de9-4d57-ad8d-67fa49f99de8', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13055, N'deleteallconversioncampaign', 0, N'DELETE FROM Analytics_ConversionCampaign WHERE ##WHERE##', 0, 2890, 0, '20110621 15:33:06', '83faa88e-37f0-46f4-933c-b671fae3552b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12450, N'selectwithhits', 0, N'SELECT ##COLUMNS##
  FROM (SELECT MVTestName, MVTestDisplayName, MVTestSiteID, MVTestID, MVTestCulture, MVTestPage, MVTestOpenFrom, MVTestOpenTo, MVTestEnabled, MVTestConversions, SUM (HitsValue) AS HitsValue,
   HitsStartTime,HitsEndTime  FROM OM_MVTest
JOIN Analytics_Statistics ON Analytics_Statistics.StatisticsCode LIKE ''mvtconversion;''+ MVTestName+ '';%''
JOIN Analytics_YearHits ON Analytics_Statistics.StatisticsID = Analytics_YearHits.HitsStatisticsID
GROUP BY MVTestName, MVTestDisplayName, MVTestID, MVTestCulture, MVTestPage, MVTestOpenFrom, MVTestOpenTo, MVTestEnabled, MVTestConversions, MVTestSiteID
,HitsStartTime,HitsEndTime
) AS X
WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2806, 0, '20110623 10:29:20', 'd0fd7003-2fa4-41f9-b5ef-3af800c23d1b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13232, N'SelectWithHitsDays', 0, N'SELECT ##COLUMNS##
  FROM (SELECT MVTestName, MVTestDisplayName, MVTestSiteID, MVTestID, MVTestCulture, MVTestPage, MVTestOpenFrom, MVTestOpenTo, MVTestEnabled, SUM(HitsCount) AS MVTestConversions, SUM (HitsValue) AS HitsValue
   FROM OM_MVTest
JOIN Analytics_Statistics ON Analytics_Statistics.StatisticsCode LIKE ''mvtconversion;''+ MVTestName+ '';%''
JOIN Analytics_DayHits ON Analytics_Statistics.StatisticsID = Analytics_DayHits.HitsStatisticsID
WHERE HitsStartTime >= @From AND HitsEndTime <= @To
GROUP BY MVTestName, MVTestDisplayName, MVTestID, MVTestCulture, MVTestPage, MVTestOpenFrom, MVTestOpenTo, MVTestEnabled, MVTestConversions, MVTestSiteID
) AS X
WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2806, 0, '20110623 11:27:41', '7baa84a9-1d13-4a16-ae4a-2215757cd1c9', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13233, N'SelectWithHitsHours', 0, N'SELECT ##COLUMNS##
  FROM (SELECT MVTestName, MVTestDisplayName, MVTestSiteID, MVTestID, MVTestCulture, MVTestPage, MVTestOpenFrom, MVTestOpenTo, MVTestEnabled, SUM(HitsCount) AS MVTestConversions, SUM (HitsValue) AS HitsValue
   FROM OM_MVTest
JOIN Analytics_Statistics ON Analytics_Statistics.StatisticsCode LIKE ''mvtconversion;''+ MVTestName+ '';%''
JOIN Analytics_HourHits ON Analytics_Statistics.StatisticsID = Analytics_HourHits.HitsStatisticsID
WHERE HitsStartTime >= @From AND HitsEndTime <= @To
GROUP BY MVTestName, MVTestDisplayName, MVTestID, MVTestCulture, MVTestPage, MVTestOpenFrom, MVTestOpenTo, MVTestEnabled, MVTestConversions, MVTestSiteID
) AS X
WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2806, 0, '20110623 12:14:15', '6b2ce4de-5f24-4b8c-9c3b-38c40ed52203', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13234, N'SelectWithHitsWeeks', 0, N'SELECT ##COLUMNS##
  FROM (SELECT MVTestName, MVTestDisplayName, MVTestSiteID, MVTestID, MVTestCulture, MVTestPage, MVTestOpenFrom, MVTestOpenTo, MVTestEnabled, SUM(HitsCount) AS MVTestConversions, SUM (HitsValue) AS HitsValue
   FROM OM_MVTest
JOIN Analytics_Statistics ON Analytics_Statistics.StatisticsCode LIKE ''mvtconversion;''+ MVTestName+ '';%''
JOIN Analytics_WeekHits ON Analytics_Statistics.StatisticsID = Analytics_WeekHits.HitsStatisticsID
WHERE HitsStartTime >= @From AND HitsEndTime <= @To
GROUP BY MVTestName, MVTestDisplayName, MVTestID, MVTestCulture, MVTestPage, MVTestOpenFrom, MVTestOpenTo, MVTestEnabled, MVTestConversions, MVTestSiteID
) AS X
WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2806, 0, '20110623 12:14:50', '76516176-ba4d-413a-ba6c-b433e2f5eac3', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13235, N'SelectWithHitsMonths', 0, N'SELECT ##COLUMNS##
  FROM (SELECT MVTestName, MVTestDisplayName, MVTestSiteID, MVTestID, MVTestCulture, MVTestPage, MVTestOpenFrom, MVTestOpenTo, MVTestEnabled, SUM(HitsCount) AS MVTestConversions, SUM (HitsValue) AS HitsValue
   FROM OM_MVTest
JOIN Analytics_Statistics ON Analytics_Statistics.StatisticsCode LIKE ''mvtconversion;''+ MVTestName+ '';%''
JOIN Analytics_MonthHits ON Analytics_Statistics.StatisticsID = Analytics_MonthHits.HitsStatisticsID
WHERE HitsStartTime >= @From AND HitsEndTime <= @To
GROUP BY MVTestName, MVTestDisplayName, MVTestID, MVTestCulture, MVTestPage, MVTestOpenFrom, MVTestOpenTo, MVTestEnabled, MVTestConversions, MVTestSiteID
) AS X
WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2806, 0, '20110623 12:15:22', 'b51901e1-f7c7-45af-9a76-565cedc48e2b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13236, N'SelectWithHitsYears', 0, N'SELECT ##COLUMNS##
  FROM (SELECT MVTestName, MVTestDisplayName, MVTestSiteID, MVTestID, MVTestCulture, MVTestPage, MVTestOpenFrom, MVTestOpenTo, MVTestEnabled, SUM(HitsCount) AS MVTestConversions, SUM (HitsValue) AS HitsValue
   FROM OM_MVTest
JOIN Analytics_Statistics ON Analytics_Statistics.StatisticsCode LIKE ''mvtconversion;''+ MVTestName+ '';%''
JOIN Analytics_YearHits ON Analytics_Statistics.StatisticsID = Analytics_YearHits.HitsStatisticsID
WHERE HitsStartTime >= @From AND HitsEndTime <= @To
GROUP BY MVTestName, MVTestDisplayName, MVTestID, MVTestCulture, MVTestPage, MVTestOpenFrom, MVTestOpenTo, MVTestEnabled, MVTestConversions, MVTestSiteID
) AS X
WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2806, 0, '20110623 12:15:47', 'eb4ecd07-d3a1-49e7-a5f8-d159da2fd72b', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12687, N'select', 0, N'SELECT ##COLUMNS## FROM OM_Membership WHERE [MembershipID] = @ID', 0, 2853, 0, '20110623 16:39:53', '5d272856-4bfd-42ff-bdf5-ed683a9e196c', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12688, N'delete', 0, N'DELETE FROM OM_Membership WHERE [MembershipID] = @ID', 0, 2853, 0, '20110623 16:39:53', '1edb1206-b7a4-42a5-b4b4-b04840a3f94a', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12689, N'insert', 0, N'INSERT INTO OM_Membership ([RelatedID], [MemberType], [MembershipGUID], [MembershipCreated], [OriginalContactID], [ActiveContactID] ) VALUES ( @RelatedID, @MemberType, @MembershipGUID, @MembershipCreated, @OriginalContactID, @ActiveContactID); SELECT SCOPE_IDENTITY() AS [MembershipID]', 1, 2853, 0, '20110623 16:39:53', '60f5f313-7c19-430f-ba66-2037e691fc36', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12690, N'update', 0, N'UPDATE OM_Membership SET [RelatedID] = @RelatedID, [MemberType] = @MemberType, [MembershipGUID] = @MembershipGUID, [MembershipCreated] = @MembershipCreated, [OriginalContactID] = @OriginalContactID, [ActiveContactID] = @ActiveContactID WHERE [MembershipID] = @MembershipID', 0, 2853, 0, '20110623 16:39:53', 'be7510bf-7518-4784-abe8-1bc550f90b73', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12691, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM OM_Membership WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2853, 0, '20110623 16:39:53', '77a4d8dc-fb0e-40e1-82e0-1e4090174af5', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12692, N'deleteall', 0, N'DELETE FROM OM_Membership WHERE ##WHERE##', 0, 2853, 0, '20110623 16:39:53', '1815ec8c-743c-4c27-a25e-3d9914ba1fd4', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12693, N'updateall', 0, N'UPDATE OM_Membership SET ##COLUMNS## WHERE ##WHERE##', 0, 2853, 0, '20110623 16:39:53', 'e2d2da82-9821-446e-9201-5e4988b62441', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13237, N'getlastlogged', 0, N'SELECT TOP 1 ContactID
FROM OM_Contact 
LEFT JOIN OM_Activity ON OM_Activity.ActivityActiveContactID = OM_Contact.ContactID 
WHERE ##WHERE##
GROUP BY ContactID, ActivityCreated
ORDER BY ActivityCreated DESC', 0, 2841, 0, '20110623 16:44:11', '92440064-2f7a-4569-b94d-5307970fd606', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13238, N'getmostactive', 0, N'SELECT TOP 1 ContactID, COUNT(*) AS Number
FROM OM_Contact 
LEFT JOIN OM_Activity ON OM_Activity.ActivityActiveContactID = OM_Contact.ContactID 
WHERE ##WHERE##
GROUP BY ContactID
ORDER BY Number DESC', 0, 2841, 0, '20110623 17:07:10', '352a6e23-6e01-4d01-bdb3-0152cd70b5d9', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12989, N'select', 0, N'SELECT ##COLUMNS## FROM Integration_Task WHERE [TaskID] = @ID', 0, 2885, 0, '20110628 04:14:02', '92694570-d090-4a8e-aab8-4b881761ec81', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12990, N'delete', 0, N'DELETE FROM Integration_Task WHERE [TaskID] = @ID', 0, 2885, 0, '20110628 04:14:02', '5342bb29-1ccc-4728-8874-b3948a61ca36', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12993, N'selectall', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Integration_Task WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 2885, 0, '20110628 04:14:02', '96fb4acb-46a1-4612-8d39-5dbe3817b2b2', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13249, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Integration_Task WHERE (TaskTime >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 2885, 0, '20110628 04:14:02', 'ac3ff4b1-9272-4495-b787-7f991ff80126', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12994, N'deleteall', 0, N'DELETE FROM Integration_Task WHERE ##WHERE##', 0, 2885, 0, '20110628 04:14:02', 'f9bf3532-0a5f-4ff5-9f5f-130fe2cf32ea', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12995, N'updateall', 0, N'UPDATE Integration_Task SET ##COLUMNS## WHERE ##WHERE##', 0, 2885, 0, '20110628 04:14:02', '930b1eba-a865-47cf-aacd-027819123829', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (13250, N'removerelationship', 1, N'Proc_OM_Membership_RemoveRelationship', 0, 2853, 0, '20110628 08:07:26', '46331292-e85c-4b52-a0c4-dea9505a108d', 0, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (1276, N'select', 0, N'SELECT ##COLUMNS## FROM CMS_Form WHERE [FormID] = @ID', 0, 880, 0, '20110628 12:30:53', 'aa931e0f-6443-4b34-9704-dc72a4b8a542', 0, NULL)
SET IDENTITY_INSERT [CMS_Query] OFF
